package mblog.advise;

import java.util.Date;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
@Component
@Aspect
public class ControllerAdvice {
	
	private Logger logger = LoggerFactory.getLogger(getClass());

	public ControllerAdvice(){}
	
	
	@Pointcut("within(mblog.web.controller..*Controller)")
	public void ExcuteFunc() {	}
	
	@Around("ExcuteFunc()")
	public Object InvokeMethod(ProceedingJoinPoint thisJoinPoint) throws Throwable {
//		logger.info("=========ControllerAdvice working===========");
		String controllerAndFuncName = thisJoinPoint.getSignature().getDeclaringType() + "."
				+ thisJoinPoint.getSignature().getName();
//		logger.info("Controller And Function Name: " + controllerAndFuncName);
		return thisJoinPoint.proceed();
	}
}
